/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package com.nokia.lib.iap;

import javax.microedition.lcdui.Display;
import javax.microedition.midlet.MIDlet;

/**
 *
 * @author zinin
 */
public abstract class TrynBuyWrapperListener extends MIDlet{
    private static IapCanvas iapcanvas = null;
                
    public TrynBuyWrapperListener(){
        iapcanvas = new IapCanvas(this);
    }

    public void startMIDlet() {
        if(iapcanvas.isBought()){
            launchApp();
        }else{
            Display.getDisplay(this).setCurrent(iapcanvas);
        }
    }
    
    public abstract void launchApp();
    
    public void exit(){
        notifyDestroyed();
    }
}
